<form id="info_form" name="info_form" action="{:U('user/topclass')}" method="post">
	<table width="100%" class="table_form">  
		<tr>
			<th width="100">团队名称 :</th>
			<td>
				<select name="topkey">
				<option value="">请选择团队</option>
				<volist name="team" id="val">
				<option value="{$val.title}" <if condition="$val['title'] eq $info['topkey']">selected</if>>{$val.title}</option>
				</volist>
				</select>
			</td>
		</tr>
		<tr>
			<th width="100">团队级别 :</th>
			<td>
				<select name="tgroup">
					<option value="">请选择级别</option>
					<volist name="tgroup" id="g" key="$key">
					<option value="{$key}" <if condition="$info[tgroup] eq $key">selected</if>>{$g}</option>
					</volist>
				</select>
			</td>
		</tr>
		<tr>
			<th width="100">关联上级 :</th>
			<td id="J_user_select_box">
				<select name="tgroup_1" class="J_user_select" data-pid="0" data-selected="{:implode('|',$data)}" data-uri="{:U('team/tgroup_child',array('topkey'=>$info['topkey']))}" data-name="tgroup_" data-nums="{$select_nums}"></select>
			</td>
		</tr>
		<tr>
			<th width="100">收益比例 :</th>
			<td>
				<input type="text" name="pers" class="input-text" value="{$info.pers}" size="5"> %
			</td>
		</tr>

		<tr>
			<th width="100">团队管理员 :</th>
			<td>
				<label><input type="radio" name="topclass" value="1" <if condition="$info[topclass] eq 1">checked</if>> 是</label>&nbsp;&nbsp;
				<label><input type="radio" name="topclass" value="0" <if condition="$info[topclass] eq 0">checked</if>> 否</label>
			</td>
		</tr> 
	</table>
	<input name="id" type="hidden" value="{$id}"  />
</form>
<script type="text/javascript">
$(function(){
	$('#info_form').ajaxForm({success:complate,dataType:'json'});
    function complate(result){
        if(result.status == 1){
            $.dialog.get(result.dialog).close();
            $.pinphp.tip({content:result.msg});
            window.location.reload();
        } else {
            $.pinphp.tip({content:result.msg, icon:'alert'});
        }
    }
	$('.J_user_select').cate_select();

	$('select[name="topkey"]').change(function(){
		$('#J_user_select_box').html('<select name="tgroup_1" class="J_user_select" data-pid="0" data-selected="{:implode('|',$data)}" data-uri="/?g=admin&m=team&a=tgroup_child&topkey='+$(this).val()+'" data-name="tgroup_" data-nums="{$select_nums}"></select>');
		$('.J_user_select').cate_select();

	});

});
</script>